package lab02.test37;

import java.util.Scanner;

public class StudentDemo {
    public static void main(String[] args) {

        //本科生
        Undergraduate undergraduate = new Undergraduate();
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入本科生的姓名，类型，三科的成绩：");

        undergraduate.name = sc.next();
        undergraduate.type = sc.next();
        for (int i = 0; i < undergraduate.score.length; i++) {
            undergraduate.score[i] = sc.nextDouble();
        }

        undergraduate.avg();
        System.out.println(undergraduate.name + "\t" + undergraduate.type + "\t" + undergraduate.by());

        //研究生
        Graduate graduate = new Graduate();
        System.out.println("请输入研究生的姓名，类型以及研究生的三科成绩：");

        graduate.name = sc.next();
        graduate.type = sc.next();
        for (int i = 0;i < graduate.score.length;i++){
            graduate.score[i] = sc.nextDouble();
        }
        graduate.avg();
        System.out.println(graduate.name + "\t" + graduate.type + "\t" + graduate.by());



    }
}
